package top.xwang.firstspringboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import top.xwang.firstspringboot.entity.User;

@RestController
public class HelloController {

    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    public String test1(@RequestParam(value = "nickname") String name){
        return "test1" + name;
    }

    @RequestMapping(value = "/test2")
    public String test2(User user){
        System.out.println(user);
        return "test2-ok";
    }

    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    public String hi(){
        return "hi~";
    }


}
